package com.dpteam.service;

import com.dpteam.bean.CheckParam;
import com.dpteam.bean.OrderItemInfo;
import com.dpteam.bean.ProductRecord;
import com.dpteam.model.*;

import java.util.List;

/**
 * Created by YangZhi on 2016/1/10.
 * 销售模块：
 * 收银和退货
 */
public interface SaleService {

    /**
     * 收银：操作订单表、操作会员表、操作商品表
     * @param member
     * @param productList
     * @return
     */
    int checkOut(Member member,List<ProductRecord> productList);

    /**
     * 退货:操作退货表，操作会员表、操作商品表
     * @param orderId
     * @param productId
     * @param productNum
     * @param reasonId
     * @return
     */
    int rejectGoods(int orderId,int productId,int productNum,int reasonId);

    /**
     *
     */
    Member findMemberByPhone(String phone);

    /**
     * 销售预处理
     * @param member
     * @param productList
     * @param param
     * @return
     */
    boolean preCheck(Member member,List<ProductRecord> productList, CheckParam param);

    /**
     * 通过订单号查询订单详情
     * @param orderId
     * @return
     */
    List<OrderItemInfo> findOrderItem(int orderId);

    /**
     * 查询退货原因
     * @return
     */
    List<RejectReason> findRejectReasons();
}
